﻿using Domain;
using Domain.Entity;
using Domain.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Application.AppService.UserAppService
{
    public class UsersAppService : IUsersAppService
    {
        private readonly IUserRepository userRepository;

        public UsersAppService(IUserRepository userRepository)
        {
            this.userRepository = userRepository;
        }
        public Task<User> GetUser(User user)
        {
            return userRepository.GetUser(user);
        }

       public async Task<List<User>> GetAllUsers()
        {
            return await userRepository.GetAllUsers();
        }

		public UserFenYe DataUser(int page, int pageSize)
		{
            return userRepository.DataUser(page, pageSize);
		}

		public Task<bool> AddUser(User user)
		{
            return userRepository.AddUser(user);
		}

		public Task<bool> UpDateUser(User user)
		{
            return userRepository.UpDateUser(user);
		}

		public Task<bool> DeleteUser(int uid)
		{
            return userRepository.DeleteUser(uid);
		}

		public Task<int> maxUId()
		{
            return userRepository.maxUId();
		}
	}
}
